<template>
  <div class="about">
    <div>
      姓： <input v-model="firstName" type="text">
    </div>
    <div>
      名：<input v-model="lastName" type="text">
    </div>
    <hr />
    <div>
      姓名： {{ name }}
    </div>
    <tree :data="data"/>
  </div>
</template>
<script setup lang="ts">
import tree from '@/components/tree.vue';
import { computed, ref } from 'vue';
const firstName = ref<string>('张')
const lastName = ref<string>('三')

let name = computed<string>(() => {
  return firstName.value + '--' + lastName.value
})

const data = [
  {
    name: '1',
    checked: false,
    children: [
      {
        name: '1-1',
        checked: false,
      },
      {
        name: '1-2',
        checked: false,
      }
    ]
  },
  {
    name: '2',
    checked: false
  },
  {
    name: '3',
    checked: false,
    children: [
      {
        name: '3-1',
        checked: false,
        children: [
          {
            name: '3-1-1',
            checked: true,
          },
          {
            name: '3-1-2',
            checked: false,
          }
        ]
      },
      {
        name: '3-2',
        checked: true,
      }
    ]
  }
]
</script>
<style></style>
